home *** CD-ROM | disk | FTP | other *** search
- AddExtender ("WXSock32i.dll")
- IntControl (35, 500, 0, 0, 0)
- bOK = @TRUE
- sDial = "<dialupname>"
- nMaxRedial = <numredials>
- nRedialDelay = 10
- sPgmPath = "<pgmpath>"
- sPgmDir = "<pgmdir>"
- bSendMail = <sendmail>
- bEmpty = <empty>
- sErrDesc = ""
- nWait = 5 ; How many minutes to wait for Netscape to finish its work
-
-
- ;Dial our host (unless user is on a direct connect)...
- hConn = 0
- nNumRedials = 0
- if (sDial <> "")
- :DialIt
- hConn = DUNConnect (sDial)
- nErr = SGetLastErr ()
- if (!hConn)
- switch nErr
- case @SErrNotFound
- sErrDesc = "Couldn't connect to %sDial%: no such dial-up"
- break
- case @SErrBusy
- if (nNumRedials <= nMaxRedial)
- nNumRedials = nNumRedials + 1
- Delay (nRedialDelay)
- goto DialIt
- else
- sErrDesc = "Couldn't connect to %sDial%: Line busy"
- endif
- break
- case @SErrNoAnswer
- if (nNumRedials <= nMaxRedial)
- nNumRedials = nNumRedials + 1
- Delay (nRedialDelay)
- goto DialIt
- else
- sErrDesc = "Couldn't connect to %sDial%: No answer"
- endif
- break
- case @SErrVoice
- sErrDesc = "Couldn't connect to %sDial%: A human answered"
- break
- case nErr ; <--default
- sErrDesc = "Couldn't connect to %sDial% - error %nErr%"
- endswitch
- bOK = @FALSE
- goto LogIt
- else
- if (nErr == @SAlready)
- ; We're already connected. Don't hang up when this event is thru...
- hConn = 0
- endif
- endif
- endif
-
-
- ; Run Netscape & make it do things...
- sTitle = "Netscape"
- if (WinExist (sTitle))
- WinActivate (sTitle)
- else
- DirChange (sPgmDir)
- Run (sPgmPath, "")
- delay (2)
- endif
-
-
- ; Bring up the Mail window (which automatically gets new mail too)...
- SendKeysTo (sTitle, "!wm")
- Delay (10)
-
-
- if (WinExistChild(sTitle, "No new messages"))
- SendKey ("~")
- endif
-
- if (WinExist("Password Entry Dialog"))
- WinClose ("Password Entry Dialog")
- endif
-
-
- ; Send outgoing mail/articles (if chosen)...
- if (bSendMail)
- if (WinExist (sTitle))
- SendKeysTo (sTitle, "!fd")
- endif
- endif
-
-
- ; Wait for nWait minutes, or till user kills off Netscape manually...
- for n=1 to nWait * 6
- if (WinExist (sTitle))
- Delay (10)
- MouseMove (100+n, 100, "", "")
- endif
- next n
-
-
- ; If user hit Ctrl+Break, WIL will bring us here...
- :Cancel
-
- ; Hang up...
- :HangUp
- if (hConn)
- nRet = DUNDisconnect (hConn)
- endif
-
-
- ; Empty the trash (if chosen)...
- if (bEmpty)
- if (WinExist (sTitle))
- SendKeysTo (sTitle, "!fe")
- endif
- endif
-
-
- ; Log what we did...
- :LogIt
- if bOK == @TRUE
- sLog = "Ran Netscape"
- else
- sLog = strcat ("Error attempting to automate Netscape:", @CRLF, sErrDesc)
- endif
-
- CMLogMessage (sLog)
- Display (8, "ClockMan95", sLog)
- exit
-
- ~
-